package com.epam.command.logic;

import java.util.List;

import com.epam.dao.DAOFactory;
import com.epam.dao.DAOFactory.DAOType;
import com.epam.dao.intf.DAO;
import com.epam.dao.intf.IPurchaseDAO;
import com.epam.entity.AbstractEntity;

public class LoaderLogic {
	
	public static List<AbstractEntity> loadVouchers() {
		DAO tvd = DAOFactory.INSTANCE.getDAO(DAOType.TOURISTVOUCHER);
		List<AbstractEntity> vouchers = tvd.findAll();
		
		return vouchers;
	}
	
	public static List<AbstractEntity> loadPurchases(String login) {
		IPurchaseDAO purchasedao = (IPurchaseDAO) DAOFactory.INSTANCE.getDAO(DAOType.PURCHASE);
		List<AbstractEntity> purchases = purchasedao.findAll(login);
		
		return purchases;
	}
	
	
}
